package com.warm.pump.module.sys.dao.gen;

import java.util.List;
import java.util.Map;
import java.util.Date;
import java.math.BigDecimal;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.frame.gen.util.TypeCast;
import com.warm.pump.frame.gen.exception.ServiceException;
import com.warm.pump.module.sys.bean.po.gen.SysMenu;
import com.warm.pump.module.sys.mapper.gen.SysMenuMapper;
import com.warm.pump.module.sys.bean.po.gen.SysMenuExample;

@Repository
public class SysMenuDao {
    // 日志对象
    private transient Log log = LogFactory.getLog(this.getClass());
    @Autowired
    private SysMenuMapper sysMenuMapper;

    // 增加一个后台SysMenu表

    public boolean insert(SysMenu sysMenu) {
        try {
            sysMenuMapper.insert(sysMenu);
            log.debug("后台SysMenu表增加成功");
            return true;
        } catch (Exception e) {
            log.debug("后台SysMenu表增加失败");
            throw new ServiceException("后台SysMenu表增加失败", e);
        }
    }
    // 增加一个后台SysMenu表Selective

    public boolean insertSelective(SysMenu sysMenu) {
        try {
            sysMenuMapper.insertSelective(sysMenu);
            log.debug("后台SysMenu表增加成功");
            return true;
        } catch (Exception e) {
            log.debug("后台SysMenu表增加失败");
            throw new ServiceException("后台SysMenu表增加失败", e);
        }
    }

    // 删除一个后台SysMenu表

    public boolean deleteByPrimaryKey(Long menuId) {
        try {
            sysMenuMapper.deleteByPrimaryKey(menuId);
            log.debug("后台SysMenu表删除成功");
            return true;
        } catch (Exception e) {
            log.debug("后台SysMenu表删除失败");
            throw new ServiceException("后台SysMenu表删除失败", e);
        }
    }
    // 删除一个后台SysMenu表byMap

    public boolean deleteByMap(Map sysMenuMap) {
        try {
            sysMenuMapper.deleteByExample(createSysMenuExample(sysMenuMap, null, null));
            log.debug("后台SysMenu根据Map删除成功");
            return true;
        } catch (Exception e) {
            log.debug("后台SysMenu根据GroupID删除失败");
            throw new ServiceException("后台SysMenu根据object删除失败", e);
        }
    }
    // 修改一个后台SysMenu表

    public boolean updateByPrimaryKey(SysMenu sysMenu) {
        try {
            sysMenuMapper.updateByPrimaryKey(sysMenu);
            log.debug("后台SysMenu表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台SysMenu表修改失败");
            throw new ServiceException("后台SysMenu表修改失败", e);
        }
    }
    // 修改一个后台SysMenu表Selective

    public boolean updateByPrimaryKeySelective(SysMenu sysMenu) {
        try {
            sysMenuMapper.updateByPrimaryKeySelective(sysMenu);
            log.debug("后台SysMenu表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台SysMenu表修改失败");
            throw new ServiceException("后台SysMenu表修改失败", e);
        }
    }
    // 修改一个后台SysMenu表

    public boolean updateByMap(SysMenu sysMenu, Map sysMenuMap) {
        try {
            sysMenuMapper.updateByExample(sysMenu, createSysMenuExample(sysMenuMap, null, null));
            log.debug("后台批量SysMenu表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台批量SysMenu表修改失败");
            throw new ServiceException("后台SysMenu表批量修改失败", e);
        }
    }
    // 修改一个后台SysMenu表Selective

    public boolean updateByMapSelective(SysMenu sysMenu, Map sysMenuMap) {
        try {
            sysMenuMapper.updateByExampleSelective(sysMenu, createSysMenuExample(sysMenuMap, null, null));
            log.debug("后台批量SysMenu表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台批量SysMenu表修改失败");
            throw new ServiceException("后台SysMenu表批量修改失败", e);
        }
    }

    // 查询一个后台SysMenu表

    public SysMenu selectByPrimaryKey(Long menuId) {
        return sysMenuMapper.selectByPrimaryKey(menuId);
    }

    // 查询一个后台SysMenu表-根据map

    public SysMenu selectByMap(Map sysMenuMap) {
        List<SysMenu> list = getListByMap(sysMenuMap);
        if (list == null || list.isEmpty()) {
            return null;
        } else {
            return list.get(0);
        }
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    // 查询所有后台SysMenu表

    public List<SysMenu> getListByMap(Map sysMenuMap) {

        return sysMenuMapper.selectByExample(createSysMenuExample(sysMenuMap, null, null));
    }

    //统计后台SysMenu表数量

    public int countTotalByMap(Map sysMenuMap) {

        return sysMenuMapper.countByExample(createSysMenuExample(sysMenuMap, null, null));
    }


    public List<SysMenu> getListByMapPage(Map sysMenuMap, int limitStart,
                                          int limitOffset) {

        return sysMenuMapper.selectByExample(createSysMenuExample(sysMenuMap, limitStart, limitOffset));
    }


    public PageBean getPageBeanByMap(Map sysMenuMap, int pageNo, int pageSize) {
        Integer count = countTotalByMap(sysMenuMap);
        PageBean pageBean = new PageBean();
        pageBean.setCount(count);
        pageBean.setPageNo(pageNo);
        pageBean.setPageSize(pageSize);
        int limitStart = pageBean.getStartNo();
        int limitOffset = pageSize;
        pageBean.setData(sysMenuMapper.selectByExample(createSysMenuExample(sysMenuMap, limitStart, limitOffset)));
        return pageBean;
    }

    private SysMenuExample createSysMenuExample(Map sysMenuMap, Integer limitStart, Integer limitOffset) {
        SysMenuExample sysMenuEx = new SysMenuExample();
        SysMenuExample.Criteria c = sysMenuEx.createCriteria();
        Long menuId_null = TypeCast.getLong(sysMenuMap.get("menuId_null"));
        Long menuId_notNull = TypeCast.getLong(sysMenuMap.get("menuId_notNull"));
        Long menuId = TypeCast.getLong(sysMenuMap.get("menuId"));
        Long menuId_not = TypeCast.getLong(sysMenuMap.get("menuId_not"));
        Long menuId_greater = TypeCast.getLong(sysMenuMap.get("menuId_greater"));
        Long menuId_greaterEqual = TypeCast.getLong(sysMenuMap.get("menuId_greaterEqual"));
        Long menuId_less = TypeCast.getLong(sysMenuMap.get("menuId_less"));
        Long menuId_lessEqual = TypeCast.getLong(sysMenuMap.get("menuId_lessEqual"));
        List<Long> menuId_in = TypeCast.getLongList(sysMenuMap.get("menuId_in"));
        List<Long> menuId_notIn = TypeCast.getLongList(sysMenuMap.get("menuId_notIn"));
        Long menuId_between1 = TypeCast.getLong(sysMenuMap.get("menuId_between1"));
        Long menuId_between2 = TypeCast.getLong(sysMenuMap.get("menuId_between2"));
        Long menuId_notBetween1 = TypeCast.getLong(sysMenuMap.get("menuId_notBetween1"));
        Long menuId_notBetween2 = TypeCast.getLong(sysMenuMap.get("menuId_notBetween2"));

        if (menuId_null != null) {
            c.andMenuIdIsNull();
        }
        if (menuId_notNull != null) {
            c.andMenuIdIsNotNull();
        }
        if (menuId != null) {
            c.andMenuIdEqualTo(menuId);
        }
        if (menuId_not != null) {
            c.andMenuIdNotEqualTo(menuId_not);
        }
        if (menuId_greater != null) {
            c.andMenuIdGreaterThan(menuId_greater);
        }
        if (menuId_greaterEqual != null) {
            c.andMenuIdGreaterThanOrEqualTo(menuId_greaterEqual);
        }
        if (menuId_less != null) {
            c.andMenuIdLessThan(menuId_less);
        }
        if (menuId_lessEqual != null) {
            c.andMenuIdLessThanOrEqualTo(menuId_lessEqual);
        }
        if (menuId_in != null) {
            c.andMenuIdIn(menuId_in);
        }
        if (menuId_notIn != null) {
            c.andMenuIdNotIn(menuId_notIn);
        }
        if (menuId_between1 != null) {
            c.andMenuIdBetween(menuId_between1, menuId_between2);
        }
        if (menuId_notBetween1 != null) {
            c.andMenuIdNotBetween(menuId_notBetween1, menuId_notBetween2);
        }
        Long parentId_null = TypeCast.getLong(sysMenuMap.get("parentId_null"));
        Long parentId_notNull = TypeCast.getLong(sysMenuMap.get("parentId_notNull"));
        Long parentId = TypeCast.getLong(sysMenuMap.get("parentId"));
        Long parentId_not = TypeCast.getLong(sysMenuMap.get("parentId_not"));
        Long parentId_greater = TypeCast.getLong(sysMenuMap.get("parentId_greater"));
        Long parentId_greaterEqual = TypeCast.getLong(sysMenuMap.get("parentId_greaterEqual"));
        Long parentId_less = TypeCast.getLong(sysMenuMap.get("parentId_less"));
        Long parentId_lessEqual = TypeCast.getLong(sysMenuMap.get("parentId_lessEqual"));
        List<Long> parentId_in = TypeCast.getLongList(sysMenuMap.get("parentId_in"));
        List<Long> parentId_notIn = TypeCast.getLongList(sysMenuMap.get("parentId_notIn"));
        Long parentId_between1 = TypeCast.getLong(sysMenuMap.get("parentId_between1"));
        Long parentId_between2 = TypeCast.getLong(sysMenuMap.get("parentId_between2"));
        Long parentId_notBetween1 = TypeCast.getLong(sysMenuMap.get("parentId_notBetween1"));
        Long parentId_notBetween2 = TypeCast.getLong(sysMenuMap.get("parentId_notBetween2"));

        if (parentId_null != null) {
            c.andParentIdIsNull();
        }
        if (parentId_notNull != null) {
            c.andParentIdIsNotNull();
        }
        if (parentId != null) {
            c.andParentIdEqualTo(parentId);
        }
        if (parentId_not != null) {
            c.andParentIdNotEqualTo(parentId_not);
        }
        if (parentId_greater != null) {
            c.andParentIdGreaterThan(parentId_greater);
        }
        if (parentId_greaterEqual != null) {
            c.andParentIdGreaterThanOrEqualTo(parentId_greaterEqual);
        }
        if (parentId_less != null) {
            c.andParentIdLessThan(parentId_less);
        }
        if (parentId_lessEqual != null) {
            c.andParentIdLessThanOrEqualTo(parentId_lessEqual);
        }
        if (parentId_in != null) {
            c.andParentIdIn(parentId_in);
        }
        if (parentId_notIn != null) {
            c.andParentIdNotIn(parentId_notIn);
        }
        if (parentId_between1 != null) {
            c.andParentIdBetween(parentId_between1, parentId_between2);
        }
        if (parentId_notBetween1 != null) {
            c.andParentIdNotBetween(parentId_notBetween1, parentId_notBetween2);
        }
        String name_null = TypeCast.getString(sysMenuMap.get("name_null"));
        String name_notNull = TypeCast.getString(sysMenuMap.get("name_notNull"));
        String name = TypeCast.getString(sysMenuMap.get("name"));
        String name_not = TypeCast.getString(sysMenuMap.get("name_not"));
        String name_greater = TypeCast.getString(sysMenuMap.get("name_greater"));
        String name_greaterEqual = TypeCast.getString(sysMenuMap.get("name_greaterEqual"));
        String name_less = TypeCast.getString(sysMenuMap.get("name_less"));
        String name_lessEqual = TypeCast.getString(sysMenuMap.get("name_lessEqual"));
        String name_like = TypeCast.getString(sysMenuMap.get("name_like"));
        String name_notLike = TypeCast.getString(sysMenuMap.get("name_notLike"));
        List<String> name_in = TypeCast.getStringList(sysMenuMap.get("name_in"));
        List<String> name_notIn = TypeCast.getStringList(sysMenuMap.get("name_notIn"));
        String name_between1 = TypeCast.getString(sysMenuMap.get("name_between1"));
        String name_between2 = TypeCast.getString(sysMenuMap.get("name_between2"));
        String name_notBetween1 = TypeCast.getString(sysMenuMap.get("name_notBetween1"));
        String name_notBetween2 = TypeCast.getString(sysMenuMap.get("name_notBetween2"));

        if (name_null != null) {
            c.andNameIsNull();
        }
        if (name_notNull != null) {
            c.andNameIsNotNull();
        }
        if (name != null) {
            c.andNameEqualTo(name);
        }
        if (name_not != null) {
            c.andNameNotEqualTo(name_not);
        }
        if (name_greater != null) {
            c.andNameGreaterThan(name_greater);
        }
        if (name_greaterEqual != null) {
            c.andNameGreaterThanOrEqualTo(name_greaterEqual);
        }
        if (name_less != null) {
            c.andNameLessThan(name_less);
        }
        if (name_lessEqual != null) {
            c.andNameLessThanOrEqualTo(name_lessEqual);
        }
        if (name_like != null) {
            c.andNameLike(name_like);
        }
        if (name_notLike != null) {
            c.andNameNotLike(name_notLike);
        }
        if (name_in != null) {
            c.andNameIn(name_in);
        }
        if (name_notIn != null) {
            c.andNameNotIn(name_notIn);
        }
        if (name_between1 != null) {
            c.andNameBetween(name_between1, name_between2);
        }
        if (name_notBetween1 != null) {
            c.andNameNotBetween(name_notBetween1, name_notBetween2);
        }
        String url_null = TypeCast.getString(sysMenuMap.get("url_null"));
        String url_notNull = TypeCast.getString(sysMenuMap.get("url_notNull"));
        String url = TypeCast.getString(sysMenuMap.get("url"));
        String url_not = TypeCast.getString(sysMenuMap.get("url_not"));
        String url_greater = TypeCast.getString(sysMenuMap.get("url_greater"));
        String url_greaterEqual = TypeCast.getString(sysMenuMap.get("url_greaterEqual"));
        String url_less = TypeCast.getString(sysMenuMap.get("url_less"));
        String url_lessEqual = TypeCast.getString(sysMenuMap.get("url_lessEqual"));
        String url_like = TypeCast.getString(sysMenuMap.get("url_like"));
        String url_notLike = TypeCast.getString(sysMenuMap.get("url_notLike"));
        List<String> url_in = TypeCast.getStringList(sysMenuMap.get("url_in"));
        List<String> url_notIn = TypeCast.getStringList(sysMenuMap.get("url_notIn"));
        String url_between1 = TypeCast.getString(sysMenuMap.get("url_between1"));
        String url_between2 = TypeCast.getString(sysMenuMap.get("url_between2"));
        String url_notBetween1 = TypeCast.getString(sysMenuMap.get("url_notBetween1"));
        String url_notBetween2 = TypeCast.getString(sysMenuMap.get("url_notBetween2"));

        if (url_null != null) {
            c.andUrlIsNull();
        }
        if (url_notNull != null) {
            c.andUrlIsNotNull();
        }
        if (url != null) {
            c.andUrlEqualTo(url);
        }
        if (url_not != null) {
            c.andUrlNotEqualTo(url_not);
        }
        if (url_greater != null) {
            c.andUrlGreaterThan(url_greater);
        }
        if (url_greaterEqual != null) {
            c.andUrlGreaterThanOrEqualTo(url_greaterEqual);
        }
        if (url_less != null) {
            c.andUrlLessThan(url_less);
        }
        if (url_lessEqual != null) {
            c.andUrlLessThanOrEqualTo(url_lessEqual);
        }
        if (url_like != null) {
            c.andUrlLike(url_like);
        }
        if (url_notLike != null) {
            c.andUrlNotLike(url_notLike);
        }
        if (url_in != null) {
            c.andUrlIn(url_in);
        }
        if (url_notIn != null) {
            c.andUrlNotIn(url_notIn);
        }
        if (url_between1 != null) {
            c.andUrlBetween(url_between1, url_between2);
        }
        if (url_notBetween1 != null) {
            c.andUrlNotBetween(url_notBetween1, url_notBetween2);
        }
        String perms_null = TypeCast.getString(sysMenuMap.get("perms_null"));
        String perms_notNull = TypeCast.getString(sysMenuMap.get("perms_notNull"));
        String perms = TypeCast.getString(sysMenuMap.get("perms"));
        String perms_not = TypeCast.getString(sysMenuMap.get("perms_not"));
        String perms_greater = TypeCast.getString(sysMenuMap.get("perms_greater"));
        String perms_greaterEqual = TypeCast.getString(sysMenuMap.get("perms_greaterEqual"));
        String perms_less = TypeCast.getString(sysMenuMap.get("perms_less"));
        String perms_lessEqual = TypeCast.getString(sysMenuMap.get("perms_lessEqual"));
        String perms_like = TypeCast.getString(sysMenuMap.get("perms_like"));
        String perms_notLike = TypeCast.getString(sysMenuMap.get("perms_notLike"));
        List<String> perms_in = TypeCast.getStringList(sysMenuMap.get("perms_in"));
        List<String> perms_notIn = TypeCast.getStringList(sysMenuMap.get("perms_notIn"));
        String perms_between1 = TypeCast.getString(sysMenuMap.get("perms_between1"));
        String perms_between2 = TypeCast.getString(sysMenuMap.get("perms_between2"));
        String perms_notBetween1 = TypeCast.getString(sysMenuMap.get("perms_notBetween1"));
        String perms_notBetween2 = TypeCast.getString(sysMenuMap.get("perms_notBetween2"));

        if (perms_null != null) {
            c.andPermsIsNull();
        }
        if (perms_notNull != null) {
            c.andPermsIsNotNull();
        }
        if (perms != null) {
            c.andPermsEqualTo(perms);
        }
        if (perms_not != null) {
            c.andPermsNotEqualTo(perms_not);
        }
        if (perms_greater != null) {
            c.andPermsGreaterThan(perms_greater);
        }
        if (perms_greaterEqual != null) {
            c.andPermsGreaterThanOrEqualTo(perms_greaterEqual);
        }
        if (perms_less != null) {
            c.andPermsLessThan(perms_less);
        }
        if (perms_lessEqual != null) {
            c.andPermsLessThanOrEqualTo(perms_lessEqual);
        }
        if (perms_like != null) {
            c.andPermsLike(perms_like);
        }
        if (perms_notLike != null) {
            c.andPermsNotLike(perms_notLike);
        }
        if (perms_in != null) {
            c.andPermsIn(perms_in);
        }
        if (perms_notIn != null) {
            c.andPermsNotIn(perms_notIn);
        }
        if (perms_between1 != null) {
            c.andPermsBetween(perms_between1, perms_between2);
        }
        if (perms_notBetween1 != null) {
            c.andPermsNotBetween(perms_notBetween1, perms_notBetween2);
        }
        Integer type_null = TypeCast.getInteger(sysMenuMap.get("type_null"));
        Integer type_notNull = TypeCast.getInteger(sysMenuMap.get("type_notNull"));
        Integer type = TypeCast.getInteger(sysMenuMap.get("type"));
        Integer type_not = TypeCast.getInteger(sysMenuMap.get("type_not"));
        Integer type_greater = TypeCast.getInteger(sysMenuMap.get("type_greater"));
        Integer type_greaterEqual = TypeCast.getInteger(sysMenuMap.get("type_greaterEqual"));
        Integer type_less = TypeCast.getInteger(sysMenuMap.get("type_less"));
        Integer type_lessEqual = TypeCast.getInteger(sysMenuMap.get("type_lessEqual"));
        List<Integer> type_in = TypeCast.getIntegerList(sysMenuMap.get("type_in"));
        List<Integer> type_notIn = TypeCast.getIntegerList(sysMenuMap.get("type_notIn"));
        Integer type_between1 = TypeCast.getInteger(sysMenuMap.get("type_between1"));
        Integer type_between2 = TypeCast.getInteger(sysMenuMap.get("type_between2"));
        Integer type_notBetween1 = TypeCast.getInteger(sysMenuMap.get("type_notBetween1"));
        Integer type_notBetween2 = TypeCast.getInteger(sysMenuMap.get("type_notBetween2"));

        if (type_null != null) {
            c.andTypeIsNull();
        }
        if (type_notNull != null) {
            c.andTypeIsNotNull();
        }
        if (type != null) {
            c.andTypeEqualTo(type);
        }
        if (type_not != null) {
            c.andTypeNotEqualTo(type_not);
        }
        if (type_greater != null) {
            c.andTypeGreaterThan(type_greater);
        }
        if (type_greaterEqual != null) {
            c.andTypeGreaterThanOrEqualTo(type_greaterEqual);
        }
        if (type_less != null) {
            c.andTypeLessThan(type_less);
        }
        if (type_lessEqual != null) {
            c.andTypeLessThanOrEqualTo(type_lessEqual);
        }
        if (type_in != null) {
            c.andTypeIn(type_in);
        }
        if (type_notIn != null) {
            c.andTypeNotIn(type_notIn);
        }
        if (type_between1 != null) {
            c.andTypeBetween(type_between1, type_between2);
        }
        if (type_notBetween1 != null) {
            c.andTypeNotBetween(type_notBetween1, type_notBetween2);
        }
        String icon_null = TypeCast.getString(sysMenuMap.get("icon_null"));
        String icon_notNull = TypeCast.getString(sysMenuMap.get("icon_notNull"));
        String icon = TypeCast.getString(sysMenuMap.get("icon"));
        String icon_not = TypeCast.getString(sysMenuMap.get("icon_not"));
        String icon_greater = TypeCast.getString(sysMenuMap.get("icon_greater"));
        String icon_greaterEqual = TypeCast.getString(sysMenuMap.get("icon_greaterEqual"));
        String icon_less = TypeCast.getString(sysMenuMap.get("icon_less"));
        String icon_lessEqual = TypeCast.getString(sysMenuMap.get("icon_lessEqual"));
        String icon_like = TypeCast.getString(sysMenuMap.get("icon_like"));
        String icon_notLike = TypeCast.getString(sysMenuMap.get("icon_notLike"));
        List<String> icon_in = TypeCast.getStringList(sysMenuMap.get("icon_in"));
        List<String> icon_notIn = TypeCast.getStringList(sysMenuMap.get("icon_notIn"));
        String icon_between1 = TypeCast.getString(sysMenuMap.get("icon_between1"));
        String icon_between2 = TypeCast.getString(sysMenuMap.get("icon_between2"));
        String icon_notBetween1 = TypeCast.getString(sysMenuMap.get("icon_notBetween1"));
        String icon_notBetween2 = TypeCast.getString(sysMenuMap.get("icon_notBetween2"));

        if (icon_null != null) {
            c.andIconIsNull();
        }
        if (icon_notNull != null) {
            c.andIconIsNotNull();
        }
        if (icon != null) {
            c.andIconEqualTo(icon);
        }
        if (icon_not != null) {
            c.andIconNotEqualTo(icon_not);
        }
        if (icon_greater != null) {
            c.andIconGreaterThan(icon_greater);
        }
        if (icon_greaterEqual != null) {
            c.andIconGreaterThanOrEqualTo(icon_greaterEqual);
        }
        if (icon_less != null) {
            c.andIconLessThan(icon_less);
        }
        if (icon_lessEqual != null) {
            c.andIconLessThanOrEqualTo(icon_lessEqual);
        }
        if (icon_like != null) {
            c.andIconLike(icon_like);
        }
        if (icon_notLike != null) {
            c.andIconNotLike(icon_notLike);
        }
        if (icon_in != null) {
            c.andIconIn(icon_in);
        }
        if (icon_notIn != null) {
            c.andIconNotIn(icon_notIn);
        }
        if (icon_between1 != null) {
            c.andIconBetween(icon_between1, icon_between2);
        }
        if (icon_notBetween1 != null) {
            c.andIconNotBetween(icon_notBetween1, icon_notBetween2);
        }
        Integer orderNum_null = TypeCast.getInteger(sysMenuMap.get("orderNum_null"));
        Integer orderNum_notNull = TypeCast.getInteger(sysMenuMap.get("orderNum_notNull"));
        Integer orderNum = TypeCast.getInteger(sysMenuMap.get("orderNum"));
        Integer orderNum_not = TypeCast.getInteger(sysMenuMap.get("orderNum_not"));
        Integer orderNum_greater = TypeCast.getInteger(sysMenuMap.get("orderNum_greater"));
        Integer orderNum_greaterEqual = TypeCast.getInteger(sysMenuMap.get("orderNum_greaterEqual"));
        Integer orderNum_less = TypeCast.getInteger(sysMenuMap.get("orderNum_less"));
        Integer orderNum_lessEqual = TypeCast.getInteger(sysMenuMap.get("orderNum_lessEqual"));
        List<Integer> orderNum_in = TypeCast.getIntegerList(sysMenuMap.get("orderNum_in"));
        List<Integer> orderNum_notIn = TypeCast.getIntegerList(sysMenuMap.get("orderNum_notIn"));
        Integer orderNum_between1 = TypeCast.getInteger(sysMenuMap.get("orderNum_between1"));
        Integer orderNum_between2 = TypeCast.getInteger(sysMenuMap.get("orderNum_between2"));
        Integer orderNum_notBetween1 = TypeCast.getInteger(sysMenuMap.get("orderNum_notBetween1"));
        Integer orderNum_notBetween2 = TypeCast.getInteger(sysMenuMap.get("orderNum_notBetween2"));

        if (orderNum_null != null) {
            c.andOrderNumIsNull();
        }
        if (orderNum_notNull != null) {
            c.andOrderNumIsNotNull();
        }
        if (orderNum != null) {
            c.andOrderNumEqualTo(orderNum);
        }
        if (orderNum_not != null) {
            c.andOrderNumNotEqualTo(orderNum_not);
        }
        if (orderNum_greater != null) {
            c.andOrderNumGreaterThan(orderNum_greater);
        }
        if (orderNum_greaterEqual != null) {
            c.andOrderNumGreaterThanOrEqualTo(orderNum_greaterEqual);
        }
        if (orderNum_less != null) {
            c.andOrderNumLessThan(orderNum_less);
        }
        if (orderNum_lessEqual != null) {
            c.andOrderNumLessThanOrEqualTo(orderNum_lessEqual);
        }
        if (orderNum_in != null) {
            c.andOrderNumIn(orderNum_in);
        }
        if (orderNum_notIn != null) {
            c.andOrderNumNotIn(orderNum_notIn);
        }
        if (orderNum_between1 != null) {
            c.andOrderNumBetween(orderNum_between1, orderNum_between2);
        }
        if (orderNum_notBetween1 != null) {
            c.andOrderNumNotBetween(orderNum_notBetween1, orderNum_notBetween2);
        }
        if (sysMenuMap.get("orderBy") != null) {
            sysMenuEx.setOrderByClause((String) sysMenuMap.get("orderBy"));
        }
        if (limitStart != null && limitOffset != null) {
            sysMenuEx.setLimitStart(limitStart);
            sysMenuEx.setLimitOffset(limitOffset);
        }

        return sysMenuEx;
    }
}
